<html>
<body>

<?php

mysql_connect("localhost","vishwanath","WaLAQqSdwpa4udJT","dictionarydb");

$word = mysql_real_escape_string($_POST['word']);
$meaning = mysql_real_escape_string($_POST['meaning']);
$sentense = mysql_real_escape_string($_POST['sentense']);

if (mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$query = "insert into dictionarydb.words values (default,'$word','$meaning','$sentense')";
mysql_query($query);

if(mysql_errno() == 1062)
{
    echo "You have already stored this word";
}
else
{
    echo "success";
}


?>
</body>
</html> 